# Title     : TODO
# Objective : TODO
# Created by: Administrator
# Created on: 2019/7/24

library(ggrepel)
library(ropls)
library(pROC)
library(egg)
library(randomForest)
library(Boruta)
library(magrittr)
library(optparse)
library(tidyverse)

createWhenNoExist <- function(f) {
  !dir.exists(f) && dir.create(f)
}

option_list <- list(
  make_option("--i", default = "out.txt", type = "character", help = "input file")
)
opt <- parse_args(OptionParser(option_list = option_list))

options(digits = 3)



plotData <- read_tsv(opt$i) %>%
  mutate(group=factor(group,levels = c("NC","CPP","DC","PC","CL","CM","CH")))

print(plotData %>% .$group %>% unique() )

p <- ggplot(plotData, mapping = aes(x = group, y =shannon ,fill=group)) +
  ylab("shannon") +
  xlab("class") +
  theme_bw(base_size = 8.8, base_family = "Times") +
  theme(legend.position = 'right') +
  geom_boxplot(width = 0.5,outlier.shape = NA)+
  geom_jitter(size = 0.75,color="grey")+
  labs(fill = "class")
# +
#   scale_fill_manual("finalDecision", values = fillColors)

pdfFileName <- str_c("shannon_Boxplot.pdf")

ggsave(limitsize = FALSE,pdfFileName, p, width = 5, height = 3)









